const promise = new Promise((resolve, reject) => {
    console.log(1);   
    resolve('success');   // 该状态，保存值
    console.log(2);
});

promise.then(() => {    // Promise.then加入微任务队列
    console.log(3);
});

console.log(4);

// 执行完4后，检查微任务队列，执行then

// 1 -> 2 -> 4 -> 3